From: Luca BRUNO Date: Thu, 13 Oct 2022 10:48:38 +0000 (+0000) Subject: lib/bootloader-zipl: check for errors when opening initrd X-Git-Tag: archive/raspbian/2022.7-2+rpi1^2~13^2^2~35^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=39ef6253e9934994539690e2931afd75b4617c3e;p=ostree.git lib/bootloader-zipl: check for errors when opening initrd This adds a missing error check when opening an initrd in s390x Secure Execution (SE) logic. It was detected by RH internal static checks. --- diff --git a/src/libostree/ostree-bootloader-zipl.c b/src/libostree/ostree-bootloader-zipl.c index 05a3b2ac..c9ca4219 100644 --- a/src/libostree/ostree-bootloader-zipl.c +++ b/src/libostree/ostree-bootloader-zipl.c @@ -273,7 +273,8 @@ _ostree_secure_execution_generate_initrd (const gchar *initrd, return glnx_prefix_error (error, "s390x SE: opening new ramdisk"); { glnx_autofd int fd = -1; - glnx_openat_rdonly (AT_FDCWD, initrd, TRUE, &fd, error); + if (!glnx_openat_rdonly (AT_FDCWD, initrd, TRUE, &fd, error)) + return glnx_prefix_error (error, "s390x SE: opening initrd"); if (glnx_regfile_copy_bytes (fd, out_initrd->fd, (off_t) -1) < 0) return glnx_throw_errno_prefix (error, "s390x SE: copying ramdisk"); }